import { getUserLoginAPI } from '@/api/index'

export default {
  namespaced: true,
  state: {
    token: ''
  },
  mutations: {
    getToken(state, token) {
      state.token = token
    },
    removeToken(state) {
      state.token = ''
    }
  },
  actions: {
    async getUserToken({ commit }, data) {
      const {data:res} = await getUserLoginAPI(data)
      console.log(res);
      commit('getToken',res.token)
    }
  }
}